package coop.bancocredicoop.proyectos.gd.fileListing;

import java.io.File;
import java.io.IOException;

public class FileItem extends DirectoryItem {

	private File file;
	private DocumentBrowser browser;
	
	public FileItem(File file, DocumentBrowser browser) {
		this.file = file;
		this.browser = browser;
	}
	
	public String getName() {
		return file.getName();
	}

	public boolean getIsDirectory() {
		return false;
	}

	public boolean getIsDocument() {
		return true;
	}
	
	@Override
	public String getRelativePath() throws IOException, InvalidFolderException {
		return browser.getRelativePath(file);
	}

}
